package com.zy.servlet.yhgl;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zhang.sys.SysGroupDAO;
import com.zhang.sys.SysRoleDAO;

public class FindSJ extends HttpServlet {


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setCharacterEncoding("UTF-8");
		response.setContentType("appliaction/x-json;charset=utf-8");
		PrintWriter out = response.getWriter();
		String roleid=request.getParameter("roleid");
		String groupid=request.getParameter("csid");
		SysRoleDAO roledao=new SysRoleDAO();
		String rolename=roledao.findById(roleid).getRoleName();
		SysGroupDAO csdao=new SysGroupDAO();
		String csname=csdao.findById(groupid).getGroupName();
		out.println("{success:true,data:{rolename:'"+rolename+"',csname:'"+csname+"'}}");
		out.flush();
		out.close();
	}

}
